package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.List;

public class Menu {

    // TODO validar string
    public List<String> optionsMenu;
    public final String messageInvalidOption = "Select a valid option! Type again.";

    public Menu() {
        optionsMenu = new ArrayList<String>();
        addOptionsOnMenu();
    }

    private void addOptionsOnMenu() {
        optionsMenu.add("List of books and movies");
        optionsMenu.add("Checkout a book");
        optionsMenu.add("Return a book");
        optionsMenu.add("Checkout a movie");
        optionsMenu.add("Quit");
    }

    public String showTheMenu() {
        String menu = "Choose an option on menu and type the referent number: \n";
        for (int i = 0; i < optionsMenu.size(); i++) {
            menu += i + " - " + optionsMenu.get(i) + "\n";
        }
        return menu;
    }

    public boolean isValidOption(int option) {
        if (option >= 0 && option < optionsMenu.size())
            return true;
        else
            return false;
    }
}
